package com.xmall.pethouse_api.mapper;

import com.xmall.pethouse_api.pojo.entity.Pet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Insert;
import java.util.List;

@Mapper
public interface PetMapper {
    // 查询当前用户的所有宠物
    @Select("SELECT * FROM pets WHERE owner_id = #{ownerId}")
    List<Pet> findByOwnerId(Long ownerId);
    
    // 插入宠物
    @Insert("INSERT INTO pets (owner_id, name, type, breed, age, gender, weight, photo_urls, created_at, updated_at) " +
            "VALUES (#{ownerId}, #{name}, #{type}, #{breed}, #{age}, #{gender}, #{weight}, #{photoUrls}, #{createdAt}, #{updatedAt})")
    void insert(Pet pet);
} 